package day03;

public class OperDemo {
    public static void main(String[] args) {
        int age=39;
        System.out.println("age=");
        System.out.println(age);
        System.out.println("age="+age);
        System.out.println("我今年"+age+"岁了");

        String name="奥特曼";
        System.out.println("大家好，我叫"+name);
        System.out.println("大家好，我叫"+name+",今年"+age+"岁了");

        age=10000000;
        name="暴龙战士";
        System.out.println("age");
        System.out.println(age);
        System.out.println("age="+age);
        System.out.println("我今年"+age+"岁了");
        System.out.println("大家好，我叫"+name);
        System.out.println("大家好，我叫"+name+"来自古老的泰坦星");

        System.out.println(10+20+"奥特曼"+30);//30奥特曼30
        System.out.println(10+20+30+"奥特曼");//60奥特曼
        System.out.println("奥特曼"+10+20+30+"奥特曼");//奥特曼102030奥特曼

        int num=6;
        int flag=num>0?1:2;
        System.out.println(flag);//1
        flag=num<0?1:2;
        System.out.println(flag);//2

        int a=8,b=4;
        int max=a>b?a:b;
        System.out.println(max);//8
        b=55;
        max=a>b?a:b;
        System.out.println(max);












        /*
        int a=5;
        a+=10;
        System.out.println(a);//15
        a*=2;
        System.out.println(a);//30
        a/=5;
        System.out.println(a);//6
        a-=6;
        System.out.println(a);//0

        //小面试题
        short s=5;
        //s=s+10;//编译错误，需要强转，改为：s=(short)(s=s+10);
        s+=10;//相当于s=(short)(s=s+10)
        //扩展算术运算符自带强转功能
        System.out.println(s);//15
        s*=10;
        System.out.println(s);//150
        s/=5;
        System.out.println(s);//30
        s-=10;
        System.out.println(s);//20

         */

        /*
        int a=5,b=10,c=5;
        boolean b1=b>=a && b<c;
        System.out.println(b1);//false
        System.out.println(b<=c && b>a);//false
        System.out.println(a==b && b<a);//false
        System.out.println(b!=c && b>a);//true
        System.out.println("----------");
        System.out.println(b>=a || b<c);//ture
        System.out.println(b>=c || b<a);//ture
        System.out.println(b!=c || b>a);//ture
        System.out.println(a==b || b<a);//false
        System.out.println("----------------------");
        boolean b2=!(a<b);
        System.out.println(b2);//false
        System.out.println(!(a>b));//ture
        System.out.println(!(a==b));//true
        System.out.println(!(a>=b));//true
        System.out.println(!(a<=b));//false
        System.out.println(!(a==c));//false
        System.out.println(!(a>=c));//false
        System.out.println(!(a<=c));//false
        System.out.println(!(a<c));//true
        System.out.println(!(a>c));//true
        System.out.println(!(b==c));//true
        System.out.println(!(b>=c));//false
        System.out.println(!(b<=c));//ture
        System.out.println(!(b!=c));//false
        System.out.println("-----------");

        int age=99;
        System.out.println(age>=18 && age<=50);//false
        age=50;
        System.out.println(age>=18 && age<=50);//true
        int score=86;
        System.out.println(score>=0 &&score<=100);//true
        score=120;
        System.out.println(score>=0 &&score<=100);//false

        System.out.println("---------------------");
        a=10;b=20;c=10;
        boolean b3=a>b && c++>2;
        System.out.println(b3);//fasle
        System.out.println(c);//10,发生短路了，因为第一个满足条件，就不执行下一个了

        boolean b4=a<b && c++>2;
        System.out.println(b3);//fasle
        System.out.println(c);//11

        a=10;b=20;c=10;
        boolean b5=b>a || c++>2;
        System.out.println(b5);//true
        System.out.println(c);//10 ,发生短路了，因为第一个满足条件，就不执行下一个了
        a=10;b=20;c=10;
        boolean b6=b<a || c++>2;
        System.out.println(b6);//true
        System.out.println(c);//11
*/

        /*
        int a=5;
        int b=10;
        int c=5;
        boolean b1=a>b;
        System.out.println(b1);//false
        System.out.println(a>b);//false
        System.out.println(a<b);//true
        System.out.println(a<=b);//true
        System.out.println(a>=b);//false
        System.out.println(a==b);//false
        System.out.println(a!=b);//true
        System.out.println("----------------------");
        System.out.println(a>c);//false
        System.out.println(a<c);//false
        System.out.println(a<=c);//true
        System.out.println(a>=c);//true
        System.out.println(a==c);//true
        System.out.println(a!=c);//false
        System.out.println("----------------------");
        System.out.println(b>c);//true
        System.out.println(b<c);//false
        System.out.println(b<=c);//false
        System.out.println(b>=c);//true
        System.out.println(b==c);//false
        System.out.println(b!=c);//true
        System.out.println("-----------------------");
        System.out.println(a%2==0);//false
        System.out.println(a+c==b);//true
        System.out.println(a+c>b);//false
        System.out.println(a++>c);//false
        System.out.println(a++>c);//true
        */

        /*
        int a=1,b=2;
        a++;
        b++;
        System.out.println(a);//2
        System.out.println(b);//3
        System.out.println(a++);//2
        System.out.println(a);//3
        System.out.println(++b);//4
        System.out.println(b);//4
        System.out.println("----------------");
        int a1=1,b1=2;
        int c=a1++;
        int d=++b1;
        System.out.println(c);//1
        System.out.println(a1);//2
        System.out.println(d);//3
        System.out.println(b1);//3
        System.out.println("----------------");
        int c1=5,d1=4;
        System.out.println(c1++);//5
        System.out.println(c1);//6
        System.out.println(++d1);//5
        System.out.println(d1);//5
        */

        /*
        int a=5,b=5;
        int c=a--;
        int d=--b;
        System.out.println(a);//4
        System.out.println(b);//4
        System.out.println(c);//5
        System.out.println(d);//4
        System.out.println(a--);//4
        System.out.println(--a);//2
        System.out.println(b--);//4
        System.out.println(--b);//2
         */
    }
}
